extends Node2D

@onready var color_rect: ColorRect = $CanvasLayer/ColorRect

@onready var character_body_2d: CharacterBody2D = $CharacterBody2D
@onready var node_2d: Node2D = $Node2D
@onready var blingtimer: Timer = $blingtimer


func _ready() -> void:
	var fade_tween = create_tween()
	fade_tween.tween_property(color_rect, "modulate:a", 0, 3)
	await fade_tween.finished
	character_body_2d.is_game_start = true


func _on_table_change_the_window() -> void:
	character_body_2d.is_game_start = false
	var fade_tween = create_tween()
	fade_tween.tween_property(color_rect, "modulate:a" , 1 , 3)
	await fade_tween.finished
	Over.over = true
	queue_free()


func _on_mind_01_start_bling_bling() -> void:
	blingtimer.start()


func _on_blingtimer_timeout() -> void:
	if node_2d.visible == true:
		node_2d.visible = false
	else:
		node_2d.visible = true
